<?php
/**
 * Created by PhpStorm.
 * User: wzy12
 * Date: 2018/10/14
 * Time: 18:24
 */

namespace app\admin\validate;


use think\Validate;

class Ad extends Validate
{
    protected $rule = [
        'id' => 'require|number',
        'position_id' => 'require',
        'ad_name|广告名称'  =>  'require',
        'ad_img' =>  'require',
        '__token__' => 'token|require'
    ];

    protected $message = [
        '__token__.require'  =>  '请不要进行非法操作',
        'position_id.require' => '请选择广告位置',
        'ad_img.require' => '请上传图片',
        'id.require' => '请不要进行非法操作'
    ];
    protected $scene = [
        'del' => ['__token__'],
        'form' => ['__token__', 'position_id', 'ad_name', 'ad_img'],
        'sort' => ['__token__', 'id'],
        'status' => ['id'],
        'del' => ['__token__']
    ];
}